package springlogdemo.demos.controller;


import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {

   // Logger logger= (Logger) LoggerFactory.getLogger(LogController.class);

    @RequestMapping("/print")
    public String print(){
        System.out.println("打印日志");
        log.info("log打印日志");
        return "打印日志";
    }

    @RequestMapping("/printLog")
    public String printLog(){

//        log.warn("--warn--");
        log.info("--info--");
        log.error("--error--");


         return "打印不同日志";
    }
}
